package com.example.myapplication;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d("op", "onCreate: ");
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);

        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        findViewById(R.id.button).setOnClickListener(view -> {
           Log.i("w" , "onClick: ");
           Intent intent = new Intent(MainActivity.this, MainActivity2.class);
            Bundle bundle = new Bundle();
            bundle.putString("address", ((EditText) findViewById(R.id.country)).getText().toString()+((EditText) findViewById(R.id.province)).getText().toString()+((EditText) findViewById(R.id.city)).getText().toString()+((EditText) findViewById(R.id.street)).getText().toString()+((EditText) findViewById(R.id.address)).getText().toString());
            bundle.putString("name",((EditText) findViewById(R.id.name)).getText().toString());
            bundle.putString("phone",((EditText) findViewById(R.id.phone)).getText().toString());
            intent.putExtras(bundle);
           startActivity(intent);
        });
    }



}
